package com.aisi.manager.controller;

import com.aisi.manager.service.FileUploadService;
import com.aisi.model.vo.common.Result;
import com.aisi.model.vo.common.ResultCodeEnum;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: shenjianZ
 * @Date: 2024/2/17 16:20
 * @Description:
 */

@RestController
@RequestMapping("/admin/system")
public class FileUploadController {
    @Resource
    private FileUploadService fileUploadService;
    @RequestMapping("/fileUpload")
    public Result<String> upload(MultipartFile file) {
        String fileUrl = fileUploadService.fileUpload(file);
        return Result.build(fileUrl, ResultCodeEnum.SUCCESS);
    }
}
